<%@ page contentType="text/html" %>
<%@ page import="com.capgemini.rdlgae.domain.Commande"%>
<html>
<head>

</head>
<body>
<div class="header">


<table>
<tr>
	<td><strong>Adresse de livraison</strong></td>
</tr>
<tr>
	<td style="font: 14px verdana, arial, helvetica, sans-serif;
    line-height: 12px;
    padding: 5px 6px;
    text-align: left;
    vertical-align: top;">Capgemini - Le Thalès</td>
</tr>
<tr>
	<td style=" font: 13px verdana, arial, helvetica, sans-serif;
    line-height: 12px;
    padding: 5px 6px;
    text-align: left;
    vertical-align: top;">Espace Européen de l'Entreprise</td>
</tr>
<tr>
	<td style=" font: 13px verdana, arial, helvetica, sans-serif;
    line-height: 12px;
    padding: 5px 6px;
    text-align: left;
    vertical-align: top;">tel. :03.90.22.86.87</td>
</tr>

</table>
</div>


<div>

<p style=" font: 14px verdana, arial, helvetica, sans-serif; text-align: left;
    vertical-align: top;">Commande pour le <strong><g:formatDate date="${dateCommande}" format="EEEE d MMMM" locale="FR"/></strong></p>
    
    <p style=" font: 14px verdana, arial, helvetica, sans-serif; text-align: right;
    vertical-align: top;color: red"><strong><a href="http://rdlgae.appspot.com/confirmorder?date=<g:formatDate date='${dateCommande}' format='dd-MM-yy'/>" style="color:red">Confirmer la lecture de la commande</a></strong></p>
<table style="border: 1px solid #ccc;
    width: 100%" cellspacing=0>
	<thead>
		<tr style="border: 0;">
			 <th style="border: 1px solid #ccc;color: #666;
    font-size: 11px;
    font-weight: bold;
    line-height: 17px;
    padding: 2px 6px;"><g:message code="commande.utilisateur.label"
				default="Utilisateur" /></th>

			<th style="border: 1px solid #ccc;color: #666;
    font-size: 11px;
    font-weight: bold;
    line-height: 17px;
    padding: 2px 6px;"><g:message code="commande.entree.label" default="Entree" /></th>

			<th style="border: 1px solid #ccc;color: #666;
    font-size: 11px;
    font-weight: bold;
    line-height: 17px;
    padding: 2px 6px;"><g:message code="commande.plat.label" default="Plat" /></th>

			<th style="border: 1px solid #ccc;color: #666;
    font-size: 11px;
    font-weight: bold;
    line-height: 17px;
    padding: 2px 6px;"><g:message code="commande.dessert.label" default="Dessert" /></th>

			<th style="border: 1px solid #ccc;color: #666;
    font-size: 11px;
    font-weight: bold;
    line-height: 17px;
    padding: 2px 6px;"><g:message code="commande.total.label" default="Total" /></th>



		</tr>
	</thead>
	<tbody>
		<g:each in="${commandes}" status="i" var="commandeInstance">

			<g:if test="${(i % 2) == 0}">
				<tr style="background: #f7f7f7;border: 0;">
			</g:if>
			<g:else>
				<tr style="background: #fff;border: 0;">
			</g:else>
			

				<td style=" border: 1px solid #ccc;font: 11px verdana, arial, helvetica, sans-serif;
    line-height: 12px;
    padding: 5px 6px;
    text-align: left;
    vertical-align: top;">
				${fieldValue(bean: commandeInstance, field: "utilisateur")}
				</td>

				<td style="border: 1px solid #ccc; font: 11px verdana, arial, helvetica, sans-serif;
    line-height: 12px;
    padding: 5px 6px;
    text-align: left;
    vertical-align: top;">
				${fieldValue(bean: commandeInstance, field: "entree")}
				</td>

				<td style="border: 1px solid #ccc; font: 11px verdana, arial, helvetica, sans-serif;
    line-height: 12px;
    padding: 5px 6px;
    text-align: left;
    vertical-align: top;">
				${fieldValue(bean: commandeInstance, field: "plat")}
				</td>

				<td style=" border: 1px solid #ccc;font: 11px verdana, arial, helvetica, sans-serif;
    line-height: 12px;
    padding: 5px 6px;
    text-align: left;
    vertical-align: top;">
				${fieldValue(bean: commandeInstance, field: "dessert")}
				</td>

				<td style="border: 1px solid #ccc;font: 11px verdana, arial, helvetica, sans-serif;
    line-height: 12px;
    padding: 5px 6px;
    text-align: left;
    vertical-align: top;">
				${fieldValue(bean: commandeInstance, field: "total")}
				</td>

			</tr>
		</g:each>
		<tr style="border: 0;">

			<td style=" font: 11px verdana, arial, helvetica, sans-serif;
    line-height: 12px;
    padding: 5px 6px;
    text-align: left;
    vertical-align: top;">TOTAL</td>

			<td></td>

			<td></td>

			<td></td>

			<td style=" font: 11px verdana, arial, helvetica, sans-serif;
    line-height: 12px;
    padding: 5px 6px;
    text-align: left;
    vertical-align: top;"><strong>${total} €</strong></td>
		</tr>
	</tbody>
</table>

<p>Résumé de la commande</p>
<ul>
	<g:each in="${recapitulatifPlat.keySet()}" status="i" var="plat">
	<li><b>${recapitulatifPlat.get(plat)}</b> x ${plat}</li>	
	</g:each>
</ul>
</div>

</body>
</html>
